public class Offer65 {
    public int add1(int a, int b) {
        while (b!=0){
            int carry = (a & b)<<1;
            a = a^b;
            b = carry;
        }
        return a;
    }
    public int add(int a, int b) {
        if (b==0){
            return a;
        }
        return add(a^b,(a&b)<<1);
    }
}
